SetData Method
The SetData procedure method allows you to programatically replace a graphic's existing data with the specified data. When the SetData method is called, the graphic window is immediately updated to display the new data.
Coordinate Systems
For the Arrow, Polygon, Polyline, and Symbol graphics, if the graphic is created in data coordinates (with the DATA keyword), then data coordinates should be supplied to the SetData method. If the graphic is created in device coordinates (with the DEVICE keyword) or normalized coordinates (with the NORMAL keyword, the default value for creation), then normalized coordinates should be supplied to the SetData method. The ConvertCoord Method may be used to convert values from one coordinate system to another.
Example
TEMP1=RANDOMU(SEED,12) * 100
TEMP2=RANDOMU(SEED,12) * 100
DAY=FINDGEN(12) * 30 + 15
p = PLOT(DAY, TEMP1, 'Db-1', $
TITLE = 'Temperature', $
XTITLE = 'Day of Year', $
YTITLE = 'Degrees Fahrenheit')
p.SetData, DAY, TEMP2
Syntax
graphic.SetData, Argument1, Argument2, ... Argumentn [, CONNECTIVITY=value] [, /ORDER]
The arguments to the SetData method should be specified in the same manner as the function call used to create the graphic.
Arguments
The input arguments depend on the graphic being modified and the number of arguments supplied. The form of the arguments is similar to the arguments supplied for the creation of the graphic.
Graphic |
1 Arg |
2 Args |
3 Args |
4 Args |
Keywords |
Coordinates |
---|---|---|---|---|---|---|
|
X, Y |
|
|
|
NORMAL unless created with /DATA |
|
Y |
X, Y |
|
|
|
DATA |
|
Values |
Locations, Values |
|
|
|
DATA |
|
|
X, Y |
|
|
|
DATA |
|
Z |
|
Z, X, Y |
|
|
DATA |
|
|
Y, Yerror |
X, Y, Yerror |
X, Y, Xerror, Yerror |
|
DATA |
|
Fillplot | Y | X, Y | DATA | |||
Image |
|
Image, X, Y |
|
ORDER |
DATA |
|
|
|
X, Y, Z |
|
|
DATA |
|
Y |
X, Y |
|
|
|
DATA |
|
Theta |
R, Theta |
|
|
|
DATA |
|
|
X, Y |
X, Y, Z |
|
CONNECTIVITY |
NORMAL unless created with /DATA |
|
|
X, Y |
X, Y, Z |
|
CONNECTIVITY |
NORMAL unless created with /DATA |
|
|
X, Y |
|
|
|
DATA |
|
|
|
X, Y, Z |
|
|
DATA |
|
|
U, V |
|
U, V, X, Y |
|
DATA |
|
Z |
|
Z, X, Y |
|
|
DATA |
|
|
X, Y |
|
|
|
NORMAL unless created with /DATA |
|
|
U, V |
|
U, V, X, Y |
|
DATA |
|
Vol0 |
Vol0, Vol1 |
|
Vol0, Vol1, Vol2, Vol3 |
|
DATA |
Keywords
CONNECTIVITY
This keyword applies only to the POLYLINE and POLYGON graphics, and is identical to the CONNECTIVITY keyword for the POLYLINE and POLYGON functions.
ORDER
This keyword applies only to an IMAGE graphic. Set this keyword to force the rows of the image data to be drawn from top to bottom. By default, image data is drawn from the bottom row up to the top row.
Version History
8.1 |
Introduced |